package com.wooophone.buyi.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.wooophone.buyi.bean.User;
import com.wooophone.buyi.bean.WeiboUser;
import com.wooophone.buyi.biz.UserBiz;
import com.wooophone.buyi.dao.UserDao;

/**
 * 用户业务层
 * @author MingliC
 *
 */
public class UserBizImpl implements UserBiz {
	
	@Autowired
	UserDao userDao;
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	public void save(User obj) {
		userDao.save(obj);
	}

	@Override
	public void update(User obj) {
		userDao.update(obj);
	}

	@Override
	public void delete(String id) {
		userDao.delete(id);
	}

	@Override
	public User get(String id) {
		return userDao.get(id);
	}

	@Override
	public List<User> list() {
		return userDao.list();
	}

	@Override
	public List<User> listByLimit(int pageNo, int pageSize) {
		return userDao.listByLimit(pageNo, pageSize);
	}

	@Override
	public long count() {
		return userDao.count();
	}

	@Override
	public User getByWeiboUser(WeiboUser weiboUser) {
		return getByWeiboUserId(weiboUser.getId());
	}

	@Override
	public User getByUserName(String userName) {
		return userDao.getByUserName(userName);
	}

	@Override
	public boolean existByUserName(String userName) {
		return userDao.existByUserName(userName);
	}

	@Override
	public boolean existByEmail(String email) {
		return userDao.existByEmail(email);
	}

	@Override
	public User getByEmail(String email) {
		return userDao.getByEmail(email);
	}

	@Override
	public User getByWeiboUserId(String id) {
		return userDao.getByWeiboUserId(id);
	}
}
